﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DTC.BLL;
using DTC.Model;
using System.Configuration;

namespace Common
{
    public class DisplaySettings
    {
        public static readonly DisplaySettings instance = new DisplaySettings();
        List<Display> displays = new List<Display>();
        private DisplaySettings()
        {
            displays = DTC.BLL.DisplaysManager.getDisplaysbyName(ConfigurationManager.AppSettings["CurrentModel"]);
        }
        public string getSubName2(string SubName)
        {
            var qr = displays.Where(d => d.SUBNAME == SubName);
            if (qr.Count() > 0)
            {
                string subName2 = qr.ToArray()[0].SUBNAME2;
                if (!string.IsNullOrEmpty(subName2))
                {
                    return subName2;
                }
            }
            return SubName;
        }
    }
}
